/**
 * 
 */
function setSupPoint(id, tyle, point) {
	window.postSetSupPoint(id, tyle, point);
}
function showTools() {
	checkedNum = 0;
	valueArray = new Array();
	var chkArray = document.getElementsByTagName("input");
	if (chkArray == null) {
		return false;
	}
	for (var i = 0; i < chkArray.length; i++) {
		if (chkArray[i].type == "checkbox") {
			if (chkArray[i].checked == true) {
				checkedNum = checkedNum + 1;
				valueArray[i] = chkArray[i].value;
			}
		}
	}
	if (checkedNum != 0) {
		document.getElementById("fudong").style.display = "block";
	} else {
		document.getElementById("fudong").style.display = "none";
	}
	$("#mdct").text(checkedNum);
//	document.getElementById("mdct").innerText=checkedNum;
}
window.postSetSupPoint = function(id, tyle, point) {
	// id reply的id tyle : 0 赞成 1反对 point 点数
	$.ajax({
		type : "post",
		url : "SetReplySupPointServlt",
		data : {
			reply_id : id,
			tyle : tyle
		},
		dateType : "json",
		success : function(data) {
			var jsondata = eval('(' + data + ')');
			if (jsondata.isSuccess == 'false') {
				return false;
			}
			$("#ajaxid_Sup_" + id).text("支持  " + jsondata.reply.SupPoint).attr(
					"title", "支持  " + jsondata.reply.SupPoint);
			$("#ajaxid_Aga_" + id).text("反对  " + jsondata.reply.AgaPoint).attr(
					"title", "反对  " + jsondata.reply.AgaPoint);
		},
		error : function() {
			// TODO do something
		}
	});
}
$(function managerTools() {
	var timer, scrollTop, sideDiv = $(
			"<div id=\"fudong\" class=\"fwinmask\" style=\"display: none; z-index: 350; right: 20px; top: 100px; position: absolute;\"></div>")
			.load("topicManagerTools.jsp").appendTo('body');
	$(window).scroll(function() {
		timer && clearTimeout(timer);
		scrollTop = $(this).scrollTop();
		timer = setTimeout(function() {
			sideDiv.animate({
				top : scrollTop + 100 + 'px'
			}, 600);
		}, 200);
	});
});
